#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Action.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Classifier;
class InputPin;

/// <summary>
/// ReclassifyObjectAction
/// A ReclassifyObjectAction is an Action that changes the Classifiers that classify
/// an object.
/// </summary>
class UMLMODEL_EXPORT ReclassifyObjectAction : public Action {

public: // Constructors and destructors
    explicit ReclassifyObjectAction(const QString& umlType="uml::ReclassifyObjectAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// isReplaceAll getter
    /// Specifies whether existing Classifiers should be removed before adding the new
    /// Classifiers.
    /// </summary>
    bool isReplaceAll() const;

    /// <summary>
    /// isReplaceAll setter
    /// Specifies whether existing Classifiers should be removed before adding the new
    /// Classifiers.
    /// </summary>
    void setIsReplaceAll(bool value);

    /// <summary>
    /// newClassifiers getter
    /// A set of Classifiers to be added to the Classifiers of the given object.
    /// </summary>
    vector<shared_ptr<Classifier>>& newClassifiers();

    /// <summary>
    /// object getter
    /// The InputPin that holds the object to be reclassified.
    /// </summary>
    shared_ptr<InputPin> object() const;

    /// <summary>
    /// object setter
    /// The InputPin that holds the object to be reclassified.
    /// </summary>
    void setObject(shared_ptr<InputPin> value);

    /// <summary>
    /// oldClassifiers getter
    /// A set of Classifiers to be removed from the Classifiers of the given object.
    /// </summary>
    vector<shared_ptr<Classifier>>& oldClassifiers();

private: // Fields
    /// <summary>
    /// isReplaceAll
    /// Specifies whether existing Classifiers should be removed before adding the new
    /// Classifiers.
    /// </summary>
    const static bool isReplaceAll_default_;
    bool isReplaceAll_= isReplaceAll_default_;

    /// <summary>
    /// newClassifiers
    /// A set of Classifiers to be added to the Classifiers of the given object.
    /// </summary>
    vector<shared_ptr<Classifier>> newClassifiers_;

    /// <summary>
    /// object
    /// The InputPin that holds the object to be reclassified.
    /// </summary>
    shared_ptr<InputPin> object_;

    /// <summary>
    /// oldClassifiers
    /// A set of Classifiers to be removed from the Classifiers of the given object.
    /// </summary>
    vector<shared_ptr<Classifier>> oldClassifiers_;

};

} // namespace uml
